//
//  DBHelper.m
//  NursingManages
//
//  Created by HuangZhen on 2017/5/25.
//  Copyright © 2017年 huangzhen. All rights reserved.
//

#import <FMDB.h>
#import "DBHelper.h"


@interface DBHelper ()

@end

@implementation DBHelper


static FMDatabase *db = nil;

+(FMDatabase *)DB {
    if (db == nil) {
        db = [FMDatabase databaseWithPath: DBHelper.GetSqlLiteFilePath];
    }
    return db;
}

+(NSString *)GetSqlLiteFilePath {
    NSString *documentPath = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES)firstObject];
    NSString *newFilePath = [documentPath stringByAppendingPathComponent:@"NurseApp.sqlite"];
    return newFilePath;
}


@end
